| *** Settings *** |
| Library        | Process |

| *** Variable *** |
| ${cmd}         | test${/}calculator |

| *** Test Cases *** | expect          | input1                    | input2            | input3                                    |
| On Valid Input     | [Template]      | Should Get Correct Answer |
|                    | 6               | 3 + 3                     |
|                    | 4               | 3 + 1                     |
|                    | -2              | 4 - 6                     |
|                    | 4               | 3 + 4 * 2 - 7             |
|                    | 2.66666666667   | 5 / 3.0 + 1               |
|                    | 3               | 1+2+3-4*3/4               |
|                    | 2.25            | 1+2+(3.-4)*3/4            |
|                    | 5               | +5                        |
|                    | -3              | -3.0                      |
|                    | 1               | 3/2                       | #integer division |
|                    | 7               | 3 +                       | 4                 |
|                    | 6               | ( 1 + 2                   | + 3               | )                                         |
|                    | 6               | 3 +                       | + 3               | #python think this is a valid expression! |

| On Invalid Input   | [Template]      | Should Report Error       |
|                    | 3 + 3 * ( 4 - 1 |
|                    | 2(3)            |
|                    | 3+()            |
|                    | +5-7-           |
|                    | *3              |
|                    | /2              |
|                    | 3/0             |
|                    | 18a32           |
|                    | @%!             |
|                    | 3 +             | 4                         | (                 |

| *** keyword *** |
| Should Get Correct Answer |
|    | [Arguments] | ${expected output} | @{input} |
|    | ${result} = | run process | ${cmd} | @{input} |
|    | should be equal as integers | ${result.rc} | 0 |
|    | should be equal as numbers | ${expected output} | ${result.stdout} | precision=10 |

| Should Report Error |
|    | [Arguments] | @{inputs} |
|    | ${result} = | run process | ${cmd} | @{inputs} |
|    | should not be equal as integers | ${result.rc} | 0 |
|    | ${errmsg} = | catenate | @{inputs} |
|    | should match | ${result.stderr} | Syntax Error: '${errmsg}' |
